

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>YSHOP管理平台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="icon" href="data:;base64,=">
    <link rel="stylesheet" href="/static/lib/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/lib/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" type="text/css" href="/static/css/iconfont-none.css" media="all">
    <link rel="stylesheet" type="text/css" href="/static/css/iconfont.css" media="all">
    <!-- <link rel="stylesheet" type="text/css" href="__STATIC_CSS__iconfont2.css"/> -->
    <link rel="stylesheet" href="/static/lib/layuiadmin/layui/css/layui.seller.css">
    <link rel="stylesheet" type="text/css" href="/static/css/style.css"/>


    <link rel="stylesheet" type="text/css" href="/static/css/iconfont.css" media="all"/>
    <!-- <link rel="stylesheet" type="text/css" href="__STATIC_CSS__iconfont2.css"/> -->
    <!--vue的使用-->
    <script src="/static/vue/vue.js"></script>


    <script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/lib/layuiadmin/layui/layui.js"></script>


    <script src="/static/js/jshop.js"></script>
<!--    <script type="text/javascript" charset="utf-8" src="/static/js/ue/ueditor.config.js"></script>-->
<!--    <script type="text/javascript" charset="utf-8" src="/static/js/ue/ueditor.all.min.js"> </script>-->

<!--    <script src="/static/lib/echarts/build/dist/echarts.js"></script>-->
<!--    <script>-->
<!--        &lt;!&ndash; 定义全局变量 &ndash;&gt;-->
<!--        var Jshop_Host = "localhost:8089";-->
<!--        var Jshop_Image = "/images/uploadImage";-->
<!--        var manage_Image = "/images/manage";-->

<!--    </script>-->
</head>
<body >
<div id="mains" class="layadmin-tabsbody-item layui-show">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            <i class="iconfont icon-caozuo"></i>快捷操作
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-carousel layadmin-carousel layadmin-shortcut">
                                <ul class="layui-row layui-col-space10 layui-this">
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('goods/index')}">
                                            <i class="iconfont icon-goods"></i>
                                            <cite>商品</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('order/index')}">
                                            <i class="iconfont icon-dingdan1"></i>
                                            <cite>订单</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('user/index')}">
                                            <i class="iconfont icon-user"></i>
                                            <cite>会员</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('notice/index')}">
                                            <i class="iconfont icon-gonggao"></i>
                                            <cite>公告</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('promotion/index')}">
                                            <i class="iconfont icon-promotion"></i>
                                            <cite>促销</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('ship/index')}">
                                            <i class="iconfont icon-bangzhupeisongfuwu"></i>
                                            <cite>配送</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('payments/index')}">
                                            <i class="iconfont icon-zhifu-01"></i>
                                            <cite>支付方式</cite>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs3">
                                        <a href="javascript:;" lay-href="{:url('setting/index')}">
                                            <i class="iconfont icon-review"></i>
                                            <cite>平台设置</cite>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            <i class="iconfont icon-daiban"></i>待办事项
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-carousel layadmin-carousel layadmin-backlog">
                                <ul class="layui-row layui-col-space10 layui-this">
                                    <li class="layui-col-xs6">
                                        <a href="javascript:;" lay-href="{:url('order/index')}" class="layadmin-backlog-body">
                                            <h3>待支付</h3>
                                            <p><cite>{$unpaid_count}</cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs6">
                                        <a href="javascript:;" lay-href="{:url('order/index')}" class="layadmin-backlog-body">
                                            <h3>待发货</h3>
                                            <p><cite>{$unship_count}</cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs6">
                                        <a href="javascript:;" lay-href="{:url('bill_aftersales/index')}" class="layadmin-backlog-body">
                                            <h3>待售后</h3>
                                            <p><cite>{$after_sales_count}</cite></p>
                                        </a>
                                    </li>
                                    <li class="layui-col-xs6">
                                        <a href="javascript:;" lay-href="{:url('goods/index')}" class="layadmin-backlog-body">
                                            <h3>库存报警</h3>
                                            <p><cite>{$goods_statics.totalWarn}</cite></p>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="iconfont icon-gonggao"></i>版本信息
                </div>

                <div class="layui-card-body layui-text" id="view">

                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="iconfont icon-dingdan1"></i>订单统计
                </div>
                <div class="layui-card-body">
                    <div id="graphic" class="">
                        <div id="main" class="main" style="height: 400px;"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="iconfont icon-user"></i>会员统计
                </div>
                <div class="layui-card-body">
                    <div id="graphics" class="">
                        <div id="users" class="main" style="height: 400px;"></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">
                    <i class="iconfont icon-dingdan1"></i>最近登录
                </div>

                <div v-if="logipInfo" class="layui-card-body" id="loginLog">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>状态</th>
                            <th>记录时间</th>
                            <th>登录IP</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="val in logipInfo">
                            <td v-if="val.state == 1">登录</td>
                            <td v-else-if="val.state == 2">退出</td>
                            <td v-else-if="val.state == 3">注册</td>
                            <td>{{ val.ctime }}</td>
                            <td>{{ val.ip }}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header loading-more">
                    <div><i class="iconfont icon-dingdan1"></i>操作日志</div>
                    <a href="{:url('OperationLog/index')}">查看更多>></a>
                </div>
                <div class="layui-card-body" id="oplog-table"></div>
            </div>
        </div>
    </div>
</div>

<script id="demo" type="text/html">
    <table class="layui-table">
        <tbody>
        {{# for(var i = 0; i
        < d.length; i++){ }} <tr>
            <td><i>{{i+1}}</i><a class="notice" href="javascript:;" id="{{d[i].id}}">{{ d[i].title }}</a></td>
        </tr>
        {{# } }} {{# if(d.length === 0){ }} 没有最新的数据 {{# } }}
        </tbody>
    </table>
</script>


<script id="version" type="text/html">
    <table class="layui-table">
        <colgroup>
            <col width="100">
            <col>
        </colgroup>
        <tbody>
        <tr>
            <td>产品名称</td>
            <td>
                {{ d.product }}
            </td>
        </tr>
        <tr>
            <td>当前版本</td>
            <td>
                {{ d.version }} <a href="https://gitee.com/hnjihai/jshop_mall" target="_blank" style="padding-left: 15px;">更新日志</a>
            </td>
        </tr>
        <tr>
            <td>是否授权</td>
            <td>
                {{# if(d.is_authorization ==true){ }}
                <a href="https://www.jihainet.com/" style="color: green;" target="_blank">已授权</a> {{# }else{ }}
                <a href="https://www.jihainet.com/" style="color: red;" target="_blank">未授权</a> {{# } }}
            </td>
        </tr>
        <tr>
            <td>产品授权</td>
            <td style="padding-bottom: 0;">
                <div class="layui-btn-container">
                    {{# if(d.is_authorization ==true){ }}
                    <a href="https://www.jihainet.com" target="_blank" class="layui-btn  layui-btn-bg">下载更新</a> {{# }else{ }}
                    <a href="https://www.jihainet.com/" target="_blank" class="layui-btn layui-btn-danger  layui-btn-bg">获取授权</a>
                    <a href="https://www.jihainet.com/" target="_blank" class="layui-btn  layui-btn-bg">立即下载</a> {{# } }}
                </div>
            </td>
        </tr>
        </tbody>
    </table>
</script>
 <script>
     new Vue({
             el: '#mains',
             data: {
                 logipInfo:[]

             },
        mounted(){
         this.getLogIp()
         },
         methods:{
             dateFormat(row, column, cellValue) {
                 return cellValue ? fecha.format(new Date(cellValue), 'YYYY-MM-DD') : '';
             },
             getLogIp(){
                 var that = this;
                 $.ajax({
                     url: "http://localhost:8089/user/selectUserLog",
                     data: {
                     },
                     type: "post",
                     dataType: "json",
                     success: function (resp) {
                         that.logipInfo = resp.data;

                     },
                     error: function () {


                     }
                 });
             }
         }

     })
 </script>


<script id="oplog" type="text/html">

    {{# if(d.length === 0){ }} 没有操作记录 {{# }else{ }}
    <table class="layui-table">
        <thead>
        <tr>
            <th>操作员</th>
            <th>操作时间</th>
            <th>操作内容</th>
            <th>操作IP</th>
        </tr>
        </thead>
        <tbody>
        {{# layui.each(d, function(index, item){ }}
        <tr>
            <td>{{ item.username }}</td>
            <td>{{ item.ctime }}</td>
            <td>{{ item.desc }}</td>
            <td>{{ item.ip }}</td>
        </tr>
        {{# }); }}
        </tbody>
    </table>
    {{# } }}
</script>


<script type="text/javascript">
    layui.use(['laytpl', 'layer'], function() {
        var $ = layui.$,
            laytpl = layui.laytpl,
            layer = layui.layer;

        /*$.get("{:url('manage/administrator/getVersion')}", function(data) {
            var getTpl = version.innerHTML,
                view = document.getElementById('view');
            laytpl(getTpl).render(data.data, function(html) {
                view.innerHTML = html;
            });
        });*/


        //获取历史登录记录
        /*   $.get("{:url('manage/User/userLogList',array('state'=>1))}", function(data) {
               var getTpl = log.innerHTML,
                   view = document.getElementById('loginLog');
               laytpl(getTpl).render(data.data, function(html) {
                   view.innerHTML = html;
               })
           });*/

        /*  JsGet("{:url('manage/OperationLog/getLastLog')}", function(data) {
              var getTpl = oplog.innerHTML,
                  view = document.getElementById('oplog-table');
              laytpl(getTpl).render(data.data, function(html) {
                  view.innerHTML = html;
              })
          });*/
    });
    // 路径配置
    require.config({
        paths: {
            echarts: '/static/lib/echarts/build/dist'
        }
    });
    require(
        ['echarts', 'echarts/chart/line'],
        function(ec) {
            var myChart = ec.init(document.getElementById('main'));
            var option = {
                title: {
                    text: '最近7天订单量统计'
                },
                tooltip: {
                    show: true
                },
                legend: {
                    "data":[
                        "已支付",
                        "已发货"
                    ]
                },
                yAxis: {
                    type: 'value'
                },
                xAxis: [
                    {
                        "type":"category",
                        "data":[
                            "28日",
                            "29日",
                            "30日",
                            "01日",
                            "02日",
                            "03日",
                            "04日"
                        ]
                    }
                ],
                series: [
                    {
                        "name":"已支付",
                        "type":"line",
                        "data":[
                            0,
                            5,
                            0,
                            1,
                            0,
                            0,
                            0,
                            8,
                            4,
                            3,
                            1,
                            3,
                            5,
                            3,
                            3,
                            2,
                            5,
                            2,
                            10,
                            14,
                            3,
                            1,
                            2,
                            1,
                            7,
                            3,
                            4,
                            3,
                            3,
                            2,
                            2,
                            2,
                            1,
                            1,
                            4,
                            3,
                            1,
                            1,
                            1,
                            2,
                            5,
                            3,
                            2,
                            1,
                            2,
                            2,
                            3,
                            2,
                            6,
                            7,
                            7,
                            4,
                            5,
                            2,
                            1,
                            3,
                            5,
                            2,
                            3,
                            2,
                            3,
                            3,
                            4,
                            5,
                            3,
                            3,
                            1,
                            10,
                            1,
                            3,
                            1,
                            1,
                            1,
                            1,
                            2,
                            2,
                            1,
                            3,
                            1,
                            2,
                            2,
                            4,
                            2,
                            2,
                            1,
                            4,
                            1,
                            3,
                            3,
                            1,
                            4,
                            8,
                            3,
                            2,
                            1,
                            6,
                            2,
                            1,
                            1,
                            2,
                            6,
                            7,
                            3,
                            9,
                            4,
                            2,
                            3,
                            1,
                            6,
                            6,
                            3,
                            4,
                            2,
                            3,
                            6,
                            6,
                            3,
                            1,
                            2,
                            2,
                            7,
                            2,
                            5,
                            4,
                            2,
                            1,
                            7,
                            5,
                            2,
                            1,
                            2,
                            1,
                            6,
                            3,
                            8,
                            6,
                            7,
                            2,
                            5,
                            11,
                            47,
                            16,
                            5,
                            1,
                            3,
                            4,
                            1,
                            6,
                            2,
                            1,
                            2,
                            5,
                            8,
                            8,
                            8,
                            6,
                            12,
                            9,
                            3,
                            22,
                            3,
                            2,
                            3,
                            2,
                            4,
                            5,
                            9,
                            14,
                            2,
                            3,
                            4,
                            6,
                            1,
                            2,
                            2,
                            1,
                            2,
                            1,
                            4,
                            2,
                            3,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            3,
                            3,
                            3,
                            1,
                            2,
                            1,
                            1,
                            3,
                            1,
                            1,
                            3,
                            1,
                            1,
                            3,
                            1,
                            3,
                            2,
                            4,
                            5,
                            2,
                            2,
                            4,
                            2,
                            2,
                            2,
                            2,
                            2,
                            3,
                            6,
                            1,
                            7,
                            8,
                            1,
                            1,
                            3,
                            1,
                            1,
                            2,
                            6,
                            3,
                            1,
                            2,
                            2,
                            2,
                            1,
                            2,
                            4,
                            1,
                            3,
                            7,
                            1,
                            2,
                            1,
                            1,
                            1,
                            11,
                            1,
                            2,
                            5,
                            1,
                            1,
                            2,
                            4,
                            2,
                            2,
                            1,
                            2,
                            5
                        ]
                    },
                    {
                        "name":"已发货",
                        "type":"line",
                        "data":[
                            1,
                            2,
                            1,
                            1,
                            1,
                            0,
                            0,
                            3,
                            3,
                            4,
                            3,
                            1,
                            1,
                            3,
                            1,
                            17,
                            8,
                            1,
                            3,
                            2,
                            7,
                            2,
                            2,
                            3,
                            1,
                            1,
                            2,
                            3,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            6,
                            2,
                            1,
                            7,
                            2,
                            3,
                            2,
                            2,
                            2,
                            3,
                            1,
                            2,
                            1,
                            1,
                            1,
                            2,
                            1,
                            5,
                            1,
                            2,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            2,
                            1,
                            2,
                            1,
                            2,
                            3,
                            1,
                            2,
                            1,
                            2,
                            6,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            2,
                            5,
                            4,
                            2,
                            4,
                            3,
                            2,
                            2,
                            3,
                            4,
                            5,
                            1,
                            3,
                            7,
                            3,
                            1,
                            1,
                            2,
                            1,
                            2,
                            2,
                            1,
                            3,
                            3,
                            5,
                            1,
                            2,
                            2,
                            1,
                            1,
                            3,
                            2,
                            1,
                            2,
                            7,
                            5,
                            3,
                            2,
                            2,
                            5,
                            7,
                            3,
                            2,
                            3,
                            5,
                            3,
                            3,
                            9,
                            10,
                            1,
                            1,
                            2,
                            1,
                            1,
                            3,
                            1,
                            1,
                            1,
                            12,
                            1,
                            2,
                            2,
                            6,
                            2,
                            1,
                            1,
                            3,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            2,
                            2,
                            4,
                            4,
                            2,
                            2,
                            1,
                            4,
                            1,
                            1,
                            5,
                            7,
                            1,
                            3,
                            8,
                            1,
                            1,
                            5,
                            3,
                            1,
                            1,
                            1,
                            1,
                            1,
                            1,
                            2,
                            3,
                            1,
                            3,
                            6,
                            4,
                            2,
                            1,
                            1,
                            1,
                            1,
                            1,
                            6,
                            1,
                            3,
                            1,
                            1,
                            2,
                            1,
                            1,
                            3
                        ]
                    }]
            };
             // $.get('{:url("order/statistics")}').done(function(data) {

             // });
            myChart.setOption(option);
        }
    );
    require(
        [
            'echarts',
            'echarts/chart/line' // 使用柱状图就加载bar模块，按需加载
        ],


        function(ec) {
            // 基于准备好的dom，初始化echarts图表
            var myChart = ec.init(document.getElementById('users'));

            var option = {

                tooltip: {
                    show: true
                },
                legend: {},
                xAxis: [],
                yAxis: [],
                series: []
            };
            /*$.get('{:url("user/statistics")}').done(function(data) {
                myChart.setOption({
                    legend: data.legend,
                    xAxis: data.xAxis,
                    series: data.series
                });
            });*/
            // 为echarts对象加载数据
            myChart.setOption(option);
        }
    );
</script>


</body>
</html>

